<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    /*子孙后代选择器*/
    body div div p{color: red}/*p3,p4,p5*/
    /*子元素选择器*/
    body>div>div>p{color: red}/*p3,p4*/
    body>div>p{color: red}/*p2*/
    div p{color: red}/*p2,p3,p4*/
    /*伪类选择器*/
    a:link{color: red}/*未访问*/
    a:visited{color: green}/*访问过*/
    a:hover{color: blue}/*悬停,鼠标停放时变色*/
    a:active{color: yellow}/*激活,点击时变色*/
  </style>

</head>
<body>
<a href="http://www.qq.com">QQ官网</a>
<a href="http://www.youku.com">QQ官网</a>
<a href="http://www.58.com">QQ官网</a>
<p>p1</p>
<div>
  <p>p2</p>
  <div><p>p3</p></div>
  <div>
    <p>p4</p>
    <div><p>p5</p></div>
  </div>
</div>
</body>
</html>